<include file="public@header"/>
</head>
<body>
<div class="layui-fluid js-check-wrap">
    <form method="post" class="js-ajax-form" action="{:url('SlideItem/listOrder')}">
        <div class="layui-card">
            <div class="layui-card-header well">
                <div class="layui-col-xs6">
                    <h3>{:lang('ADMIN_SLIDEITEM_INDEX')}</h3>
                </div>
                <div class="layui-col-xs6 text-right">
                    <!-- 添加 -->
                    <if condition="in_array('add', $actions)">
                        <a href="{:url('SlideItem/add',['slide_id'=>$slide_id])}" class="layui-btn layui-btn-normal">{:lang('ADMIN_SLIDEITEM_ADD')}</a>
                    </if>
                    <!-- 保存排序 -->
                    <if condition="in_array('listOrder', $actions)">
                        <button type="submit" class="layui-btn layui-btn-warm layui-btn-md js-ajax-submit">{:lang('SAVE_SORT')}</button>
                    </if>
                </div>
            </div>

            <div class="layui-card-body">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th width="50">{:lang('SORT')}</th>
                        <th width="50">ID</th>
                        <th>{:lang('SLIDE_ITEM_TITLE')}</th>
                        <th>{:lang('PICTURE')}</th>
                        <!-- <th>{:lang('DESCRIPTION')}</th> -->
                        <th>{:lang('LINK')}</th>
                        <th>{:lang('DISPLAY_HIDE')}</th>
                        <th width="160">{:lang('ACTIONS')}</th>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="result" item="vo">
                        <tr>
                            <td>
                                <input name="list_orders[{$vo.id}]" class="input-order" type="text" value="{$vo.list_order}">
                            </td>
                            <td>{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>
                                <if condition="!empty($vo['image'])">
                                    <a href="javascript:imagePreviewDialog('{:cmf_get_image_preview_url($vo.image)}');">
                                        <img src="{:cmf_get_image_preview_url($vo.image)}" width="200">
                                    </a>

                                </if>
                            </td>
                            <!-- <td>{$description = mb_substr($vo['description'], 0, 48,'utf-8')}</td> -->
                            <td>{$vo.url}</td>
                            <td>
                                <notempty name="vo.status">
                                    <span class="layui-btn layui-btn-normal layui-btn-xs">{:lang('DISPLAY')}</span>
                                    <else/>
                                    <span class="layui-btn layui-btn-xs layui-btn-danger">{:lang('HIDE')}</span>
                                </notempty>
                            </td>
                            <td>
                                <if condition="empty($vo['status']) eq 1">
                                    <if condition="in_array('ban', $actions)">
                                        <a href="{:url('SlideItem/ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn layui-btn layui-btn-normal layui-btn-xs"
                                   data-msg="确定显示此幻灯片吗？">{:lang('DISPLAY')}</a>
                                    </if>
                                <else/>
                                    <if condition="in_array('ban', $actions)">
                                        <a href="{:url('SlideItem/ban',array('id'=>$vo['id'],'hide'=>1))}" class="js-ajax-dialog-btn layui-btn layui-btn-warm layui-btn-xs"
                                       data-msg="确定隐藏此幻灯片吗？">{:lang('HIDE')}</a>
                                    </if>
                                </if>
                                <if condition="in_array('edit', $actions)">
                                    <a href="{:url('SlideItem/edit',array('id'=>$vo['id']))}" class="layui-btn layui-btn-xs">{:lang('EDIT')}</a>
                                </if>
                                <if condition="in_array('delete', $actions)">
                                    <a href="{:url('SlideItem/delete',array('id'=>$vo['id']))}"
                                       class="js-ajax-delete layui-btn layui-btn-danger layui-btn-xs">{:lang('DELETE')}</a>
                                </if>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
